package com.quiz.bis.mapper;

import com.quiz.bis.domain.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 统计报表持久层接口
 */
@Mapper
public interface StatMapper {
    // 考试统计
    Long countTotalExams();
    Long countExamsByStatus(@Param("status") Integer status);
    List<BaseStatModel> getExamTypeDistribution();
    List<BaseStatModel> getExamStatusDistribution();
    List<BaseStatModel> getExamDurationDistribution();

    // 试卷统计
    Long countTotalPapers();
    Long countPapersByStatus(@Param("status") Integer status);
    List<BaseStatModel> getTopUsedPapers(@Param("limit") Integer limit);
    List<BaseStatModel> getPaperDifficultyDistribution();
    List<BaseStatModel> getPaperPassRateDistribution();
    Double getAvgScoreTrend(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

    // 题目统计
    Long countTotalQuestions();
    Long countActiveQuestions();
    List<BaseStatModel> getTopUsedQuestions(@Param("limit") Integer limit);
    List<BaseStatModel> getQuestionTypeDistribution();
    List<BaseStatModel> getQuestionDifficultyDistribution();
    List<BaseStatModel> getQuestionCorrectnessDistribution();
}